package com.codeblue.tools.codeGenerator;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;

public class CommentBeanTest {

	public static void main(String[] args) throws IOException {
            
            Map<String,String> commentMap = new HashMap<String,String>();
//            
//            Field fields[] = Barrelwatercont.class.getDeclaredFields();
//    		for (Field me : fields) {
//    			Annotation[] ans = me.getAnnotations();
//    			for (Annotation annotation : ans) {
//    				if (annotation instanceof FiledComment) {
//    					commentMap.put(me.getName(), ((FiledComment) annotation).value());
//    				}
//    			}
//    		}
//    		
//    		
//    		InputStream in = new FileInputStream(new File("E:\\workspace\\wsq\\src\\com\\wsq\\common\\tools\\form.t"));
// 		    String templateString = IOUtils.toString(in);
// 		    
//		    Iterator<String> it = commentMap.keySet().iterator();
//		    while(it.hasNext()){
//		    	String name = it.next();
//		    	String value = commentMap.get(name);
//		    	String s1 = StringUtils.replace(templateString, "${name}", name);
//		    	String s2=  StringUtils.replace(s1, "${value}", value);
//		    	System.out.println(s2);
//		    }
		   
		    
//    		System.out.println(commentMap);
	}

}
